define(function(require, exports, module) {
	
	require("layout");
	require("ztree");
	
	module.exports = function() {
		var tree = {};
		return {
			data: {
				
			},
			methods: {
				init:function(params) {
					var nodes = [
						{name: "父节点1", children: [
							{name: "子节点1"},
							{name: "子节点2"}
						]}
					];
					var setting = {
						data: {
							simpleData: {
								enable: true
							}
						}
					};
					tree = $.fn.zTree.init($(this.$el).find("ul.ztree"), setting, nodes);
					return true;
				},
				destroy:function() {
					//关闭时销毁ztree
					tree.destroy();
				}
			}
		}
	}

});